/**
 * @param {number[]} position
 * @return {number}
 */
 var minCostToMoveChips = function(position) {
  return Math.min(position.filter(e => e % 2 === 0).length, position.filter(e => e % 2 === 1).length);
};